import { useContext } from "react"
import AppContext from "../context"
import { Button } from "antd"
const Child = () => {
    const { count,setCount } = useContext(AppContext)
    return (
        <>
        <h4>我是子组件</h4>
        <div>{count}</div>
        <br/>
        <Button type="primary" onClick={() => setCount(count + 1)}>修改父组件数据</Button>
        </>
    )
}
export default Child